package jpa4azure.type;

public class TypedKey extends Key {
	
	protected Class<?> type;
	
	public TypedKey(Key base, Class<?> t) {
		this.partition = base.partition;
		this.row = base.row;
		type = t;
	}

	public TypedKey(String key, Class<?> t) {
		this.partition = DEFAULT;
		this.row = key;
		type = t;
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) return true;
		if (!(that instanceof TypedKey)) return false;
		
		TypedKey thatKey = (TypedKey)that;
		return type.equals(thatKey.type) &&
				partition.equals(thatKey.partition) &&
				row.equals(thatKey.row);
	}
	
	
	


	

}
